package cn.edu.zafu.bigdata.x.bd121.shape;

/**
 * 圆类
 *
 * @author 202211091012
 */
public class Circle extends Shape {

    /**
     * 半径,设置为protected供子类直接调用
     */
    protected double redius;

    /**
     * 计算面积
     *
     * @return 面积
     */
    @Override
    public double area() {
        return Math.PI * this.redius * this.redius;
    }

    /**
     * 计算周长
     *
     * @return 周长
     */
    @Override
    public double perimeter() {
        return 2 * Math.PI * this.redius;
    }

    // region Java Bean
    public Circle(double redius) {
        this.redius = redius;
    }

    public Circle() {
    }

    public double getRedius() {
        return redius;
    }

    public void setRedius(double redius) {
        this.redius = redius;
    }
    //endregion
}
